package com.zx.article.reviewRecords.service.impl;

import java.util.List;

import com.zx.article.reviewRecords.dao.IReviewRecordsDao;
import com.zx.article.reviewRecords.dao.impl.ReviewRecordsDaoImpl;
import com.zx.article.reviewRecords.model.ReviewRecordsModel;
import com.zx.article.reviewRecords.service.IReviewRecordsService;

public class ReviewRecordsServiceImpl implements IReviewRecordsService {

	private IReviewRecordsDao recordsDao = new ReviewRecordsDaoImpl();

	@Override
	public int getCount(ReviewRecordsModel recordsModel) {
		return recordsDao.getCount(recordsModel);
	}

	@Override
	public List<ReviewRecordsModel> get(ReviewRecordsModel recordsModel) {
		return recordsDao.queryList(recordsModel);
	}

	@Override
	public String add(ReviewRecordsModel recordsModel) {
		if (recordsModel.getResult().equals("pass")) {
//			刷新结果
			recordsDao.updPass(recordsModel.getArticle());
//			添加至费用管理

		}
		return "1".equals(recordsDao.insert(recordsModel)) ? "success" : "fail";
	}

	@Override
	public String del(Integer articleInteger) {
		return recordsDao.delete(articleInteger);
	}

}
